﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business.Operations;

namespace HPDMAS.Gozlemci.IHKUyesi
{
    public partial class IHKUyesi : System.Web.UI.MasterPage
    {
        private int _rolId;
        private string _rolAdi;
        private bool yetki;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (YetkiliMi() == false)
            {
                Response.Redirect("~/Uyelik/KullaniciGirisi.aspx");
            }

            
        }

        private bool YetkiliMi()
        {
            _rolId = Convert.ToInt32(Session["rolId"]);
            _rolAdi = RolOperation.RolAdiGetByRolId(_rolId);
            if (_rolAdi != "ihkuyesi")
            {
                yetki = false;
            }
            else
            {
                yetki = true;
            }
            return yetki;
        }
    }
}